package hy.service;

import hy.dao.OrderDao;
import hy.entity.Order;
import hy.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {
    @Autowired
    OrderDao dao;
    public void addOrder(Order o){
        dao.addOrder(o);
    }

    public List<User> getAll(){
        return dao.selectAll();
    }
    public List<Order> getOrders(){
        return dao.selectOrders();
    }

    public Order getOrder(Long id){
        return dao.selectOrderById(id);
    }
}
